package com.hyacinth.lotterysystem.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hyacinth.lotterysystem.dao.entity.UserDO;
import com.hyacinth.lotterysystem.dao.handler.Encrypt;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface UserMapper extends BaseMapper<UserDO> {

    /**
     * 查询邮箱绑定人数
     *
     * @param email
     * @return
     */
    @Select("select count(*) from user where email = #{email}")
    int countByMail(@Param("email") String email);


    /**
     * 查询手机号绑定人数
     *
     * @param phoneNumber
     * @return
     */
    @Select("select count(*) from user where phone_number = #{phoneNumber}")
    int countByPhoneNumber(Encrypt phoneNumber);
}
